home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_olv_exteriorambient2.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  81 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_exteriorambient.cog
  4. #
  5. # Plays random sounds at random locations
  6. #
  7. # [DS]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message    pulse
  14.     message    startup
  15.     message    entered
  16.     message    exited
  17.  
  18.     thing        soundPos0        nolink
  19.     thing        soundPos1        nolink
  20.     thing        soundPos2        nolink
  21.     thing        soundPos3        nolink
  22.     thing        soundPos4        nolink
  23.     thing        soundPos5        nolink
  24.     thing        soundPos6        nolink
  25.     thing        soundPos7        nolink
  26.     thing        player                    local
  27.     sound        wav0=olv_outside_a01.wav        local
  28.     sound        wav1=olv_outside_a02.wav        local
  29.     sound        wav2=olv_outside_a03.wav        local
  30.     sound        wav3=olv_outside_a04.wav        local
  31.     sound        wav4=olv_outside_a05.wav        local
  32.     sound        wav5=olv_outside_a06.wav        local
  33.     sound        wav6=olv_outside_a07.wav        local
  34.     sound        wav7=olv_outside_a08.wav        local
  35.     float        minDist=5                local
  36.     float        maxDist=35                local
  37.     float        volume=0.8                local
  38.     int        sndnum                local
  39.     int        numsounds=8                local
  40.     int        numlocl=8                local        
  41.     int        cnt                    local
  42.     sector    on_sec0
  43.     sector    off_sec0
  44.     sector    off_sec1
  45.  
  46. end
  47.  
  48. code
  49.  
  50. # ........................................................................................
  51.  
  52. startup:
  53.     player=GetLocalPlayerThing();
  54.     return;
  55.  
  56. # ........................................................................................
  57. entered:
  58.     if(getSenderRef() == on_sec0)
  59.     {    
  60.         setpulse(1.0);
  61.     }
  62.     return;
  63. # ........................................................................................
  64. exited:
  65.     if((getSenderRef() == off_sec0) || (GetSenderRef() == off_sec1))
  66.     {    
  67.         setpulse(0.0);
  68.     }
  69.     return;
  70. # ........................................................................................
  71.  
  72.  
  73. pulse:
  74.     sndnum = rand()*numsounds;
  75.     cnt = rand()*numlocl;
  76. #    printint(sndnum);
  77.     PlaySoundThing(wav0[sndnum], soundPos0[cnt], volume, minDist, maxDist, 0);
  78.     return;
  79.  
  80.  
  81. end